import { Component, OnInit } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterLink, RouterOutlet } from '@angular/router';
import { SharedModule } from './shared/shared.module';
import { Select, Store } from '@ngxs/store';
import { RouterSelector } from './store/router/router.selector';
import { Observable } from 'rxjs';
import { SystemAction } from './store/system/system.action';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [CommonModule, RouterOutlet, RouterLink, SharedModule],
  templateUrl: './app.component.html',
  styleUrl: './app.component.css',
})
export class AppComponent implements OnInit {
  @Select(RouterSelector.url) url$!: Observable<any>;

  constructor(private store: Store) {
  }

  ngOnInit() {
    this.store.dispatch(new SystemAction.Init());
  }

}
